import React, { useState, useCallback } from "react";
import Style from "./index.module.less";
import IconFont from "@/components/IconFont";
import { Button, message } from "antd";
const InvertButton = ({ onClick }) => {
	const [flag, setFlag] = useState(true);
	const handleClick = useCallback(() => {
		setFlag(!flag);
		onClick();
	});
	return (
		<Button type="text" onClick={handleClick}>
			{flag && <IconFont type="icona-fenzu5" />}
			{!flag && <IconFont type="icona-fenzu51" />}
			<span className={Style.btn_text}>反选</span>
		</Button>
	);
};

export default React.memo(InvertButton);
